import { IsString, IsNotEmpty, Matches, IsIn } from 'class-validator';

export class SendCaptchaDto {
  @IsString()
  @IsNotEmpty({ message: '手机号不能为空' })
  @Matches(/^1[3-9]\d{9}$/, { message: '手机号格式不正确' })
  phone: string;

  @IsString()
  @IsNotEmpty({ message: '验证码类型不能为空' })
  @IsIn(['register', 'login', 'reset'], { message: '验证码类型只能是register、login或reset' })
  type: string;
}
